Skip to content

Conversation

@kandersolar
Copy link
Member

  • [ ] Closes #xxxx
  • I am familiar with the contributing guidelines
  • Tests added
  • [ ] Updates entries in docs/sphinx/source/reference for API changes.
  • [ ] Adds description and name entries in the appropriate "what's new" file in docs/sphinx/source/whatsnew for all changes. Includes link to the GitHub Issue with :issue:`num` or this Pull Request with :pull:`num`. Includes contributor name and/or GitHub username (link with :ghuser:`user`).
  • [ ] New code is fully documented. Includes numpydoc compliant docstrings, examples, and comments where necessary.
  • Pull request is nearly complete and ready for detailed review.
  • Maintainer: Appropriate GitHub Labels (including remote-data) and Milestone are assigned to the Pull Request and linked Issue.

Fix a few issues:

  1. The solargis API is now returning a different error message when requesting nonexistent data (log). Fix is to update the expected message.
Click to show test failure
FAILED tests/iotools/test_solargis.py::test_get_solargis_http_error - AssertionError: Regex pattern did not match.
 Regex: 'data coverage'
 Input: "{'requestId': '469d7ecc-f75e-480e-81e2-567c2d9ae83c', 'error': 'Invalid request. The request fromDate (1920-01-01) is before the available start date (1994-01-01).', 'message': '', 'path': '/ws/rest/datadelivery/request', 'timestamp': '2025-12-03T16:24:45.756Z'}"
  1. In Pandas deprecations #2600, I overlooked that "ME" is not available for our minimum supported pandas (log). It is used only in generating some test expected values, so I just hardcoded the relevant variable.
Click to show test failure
==================================== ERRORS ====================================
________________ ERROR collecting tests/iotools/test_sodapro.py ________________
pandas/_libs/tslibs/offsets.pyx:3527: in pandas._libs.tslibs.offsets._get_offset
    ???
E   KeyError: 'ME'

The above exception was the direct cause of the following exception:
pandas/_libs/tslibs/offsets.pyx:3629: in pandas._libs.tslibs.offsets.to_offset
    ???
pandas/_libs/tslibs/offsets.pyx:3533: in pandas._libs.tslibs.offsets._get_offset
    ???
E   ValueError: Invalid frequency: ME

The above exception was the direct cause of the following exception:
tests/iotools/test_sodapro.py:24: in <module>
    index_monthly = pd.date_range('2020-01-01', periods=4, freq='1ME')
/usr/share/miniconda/envs/test_env/lib/python3.10/site-packages/pandas/core/indexes/datetimes.py:1097: in date_range
    dtarr = DatetimeArray._generate_range(
/usr/share/miniconda/envs/test_env/lib/python3.10/site-packages/pandas/core/arrays/datetimes.py:406: in _generate_range
    freq = to_offset(freq)
pandas/_libs/tslibs/offsets.pyx:3540: in pandas._libs.tslibs.offsets.to_offset
    ???
pandas/_libs/tslibs/offsets.pyx:3637: in pandas._libs.tslibs.offsets.to_offset
    ???
E   ValueError: Invalid frequency: 1ME
=========================== short test summary info ============================
ERROR tests/iotools/test_sodapro.py - ValueError: Invalid frequency: 1ME
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
  1. Meteonorm tests are failing again (log). We need to stop checking exact values, as identical numbers are not guaranteed, according to the Meteonorm folks. So here I added some numerical tolerance to the checks. I'm not sure it will be enough; we might need to increase the tolerance to fully solve the problem.
Click to show test failure
FAILED tests/iotools/test_meteonorm.py::test_get_meteonorm_training - AssertionError: DataFrame.iloc[:, 1] (column name="global_horizontal_irradiance_with_shading") are different

DataFrame.iloc[:, 1] (column name="global_horizontal_irradiance_with_shading") values are different (8.33333 %)
[index]: [2023-01-01 00:30:00+00:00, 2023-01-01 01:30:00+00:00, 2023-01-01 02:30:00+00:00, 2023-01-01 03:30:00+00:00, 2023-01-01 04:30:00+00:00, 2023-01-01 05:30:00+00:00, 2023-01-01 06:30:00+00:00, 2023-01-01 07:30:00+00:00, 2023-01-01 08:30:00+00:00, 2023-01-01 09:30:00+00:00, 2023-01-01 10:30:00+00:00, 2023-01-01 11:30:00+00:00]
[left]:  [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.5, 77.48, 164.99, 210.75, 220.99]
[right]: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.68, 77.48, 164.99, 210.75, 220.99]
At positional index 7, first diff: 2.5 != 2.68

@kandersolar kandersolar added this to the v0.13.2 milestone Dec 3, 2025
@kandersolar kandersolar added testing io remote-data triggers --remote-data pytests labels Dec 3, 2025
@kandersolar kandersolar mentioned this pull request Dec 3, 2025
5 tasks
Copy link
Member

@AdamRJensen AdamRJensen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On behalf of us all, thanks for taking up the rather tedious task of fixing test failures <3

@kandersolar kandersolar merged commit cc75255 into pvlib:main Dec 3, 2025
49 checks passed
@kandersolar kandersolar deleted the iotools-errors branch December 3, 2025 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

io remote-data triggers --remote-data pytests testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants